package top.tupobi.zing.network.beiyong;

import top.tupobi.zing.network.APIFunction;
import top.tupobi.zing.network.HttpConfig;

/**
 * //        NetWorkBeiyong.request(path).baseURL(baseURL).getApi(queryOptions).subscribe(new DefaultObserver<String>() {
 * //            @Override
 * //            public void onSuccess(String response) {
 * //                LogUtils.e(response);
 * //            }
 * //        });
 */
public class NetWorkBeiyong {

    public static NetWorkBeiyong request() {
        return new NetWorkBeiyong();
    }

    private String mBaseURL = HttpConfig.BASE_URL;
    private boolean mIsSupportStringResponse = true;

    private NetWorkBeiyong() {
    }

    public NetWorkBeiyong baseURL(String baseURL) {
        this.mBaseURL = baseURL;
        return this;
    }

    public NetWorkBeiyong isSupportStringResponse(boolean isSupportStringResponse) {
        this.mIsSupportStringResponse = isSupportStringResponse;
        return this;
    }


    public APIFunction getApi() {
        return RetrofitManagerBeiyong.getInstance(mIsSupportStringResponse, mBaseURL).API();
    }

}

